<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="../principal.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:define name="principal">
        <h2>Gerenciar Odontograma do Paciente</h2>
        
        <h:form id="breadcrumb">
            <p:breadCrumb styleClass="navegacao" style="margin-top: 5px; margin-bottom: 40px">  
                <c:if test="#{loginMB.dentista.contaUsuario.tipo == 'AD'}" >  
                    <p:menuitem value="Categories" url="../user-master/menuMaster.xhtml" />  
                </c:if>
                <c:if test="#{loginMB.dentista.contaUsuario.tipo == 'DE'}" >  
                    <p:menuitem value="Categories" url="../user-simple/menuDentista.xhtml" />  
                </c:if>
                <p:menuitem value="Paciente" url="../paciente/adminPaciente.xhtml" />  
                <p:menuitem value="Gerenciar Odontograma" url="gerenciarOdontograma.xhtml" />
            </p:breadCrumb>
        </h:form>
        
        <h:form id="cad">
            <p:growl id="message"/>
            <p:fieldset legend="SELECIONE O PACIENTE" toggleable="true" toggleSpeed="500" styleClass="grupo-form">
                <h:panelGrid columns="2" styleClass="table-form" cellspacing="10">
                    <h:outputLabel for="paciente" value="*Paciente: " />
                    <h:panelGrid columns="2">
                        <p:inputText id="paciente" title="paciente" value="#{gerenciarOdontogramaMB.pacienteSelecionado.nome} #{gerenciarOdontogramaMB.pacienteSelecionado.sobrenome}" label="Nome" size="30" readonly="true" />
                        <p:commandButton onclick="pacienteDialog.show()" icon="ui-icon-search" type="button" update=":dialog:pacientes"/>
                    </h:panelGrid>
                </h:panelGrid>
                <h:panelGrid columns="1" style="text-align: right; width: 100%">
                    <p:commandButton id="gerar-odontograma" value="Gerar Odontograma" update=":cad, :dialog" action="#{gerenciarOdontogramaMB.geraraOdontograma()}" image="ui-icon-image" style="font-size: 12px;" />
                </h:panelGrid>
            </p:fieldset>

            <p:fieldset id="fieldset-odontograma" legend="ODONTOGRAMA" toggleable="true" toggleSpeed="500" styleClass="grupo-form">
                <h:panelGrid id="grafico-odontograma" columns="2" styleClass="table-form" cellspacing="10">

                    <h:panelGrid columns="8" styleClass="table-odontograma" cellspacing="15" style="border-right: 2px solid #A8A8A8; border-bottom: 2px solid #A8A8A8">

                        <p:commandLink id="d18" update="marcacaodente" title="18" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d18.numero}/#{gerenciarOdontogramaMB.d18.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d18}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d17" update="marcacaodente" title="17" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d17.numero}/#{gerenciarOdontogramaMB.d17.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d17}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d16" update="marcacaodente" title="16" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d16.numero}/#{gerenciarOdontogramaMB.d16.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d16}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d15" update="marcacaodente" title="15" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d15.numero}/#{gerenciarOdontogramaMB.d15.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d15}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d14" update="marcacaodente" title="14" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d14.numero}/#{gerenciarOdontogramaMB.d14.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d14}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d13" update="marcacaodente" title="13" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d13.numero}/#{gerenciarOdontogramaMB.d13.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d13}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d12" update="marcacaodente" title="12" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d12.numero}/#{gerenciarOdontogramaMB.d12.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d12}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d11" update="marcacaodente" title="11" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d11.numero}/#{gerenciarOdontogramaMB.d11.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d11}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>

                        <h:panelGrid id="f18" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d18.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d18.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d18.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d18.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d18.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f17" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d17.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d17.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d17.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d17.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d17.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f16" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d16.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d16.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d16.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d16.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d16.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f15" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d15.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d15.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d15.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d15.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d15.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f14" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d14.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d14.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d14.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d14.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d14.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f13" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d13.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d13.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d13.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d13.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d13.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f12" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d12.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d12.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d12.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d12.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d12.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f11" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d11.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d11.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d11.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d11.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d11.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>

                        <h:outputText value="#{gerenciarOdontogramaMB.d18.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d17.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d16.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d15.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d14.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d13.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d12.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d11.numero}"/>
                    </h:panelGrid>

                    <h:panelGrid columns="8" styleClass="table-odontograma" cellspacing="15" style="border-left: 2px solid #A8A8A8; border-bottom: 2px solid #A8A8A8">

                        <p:commandLink id="d21" update="marcacaodente" title="21" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d21.numero}/#{gerenciarOdontogramaMB.d21.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d21}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d22" update="marcacaodente" title="22" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d22.numero}/#{gerenciarOdontogramaMB.d22.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d22}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d23" update="marcacaodente" title="23" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d23.numero}/#{gerenciarOdontogramaMB.d23.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d23}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d24" update="marcacaodente" title="24" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d24.numero}/#{gerenciarOdontogramaMB.d24.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d24}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d25" update="marcacaodente" title="25" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d25.numero}/#{gerenciarOdontogramaMB.d25.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d25}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d26" update="marcacaodente" title="26" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d26.numero}/#{gerenciarOdontogramaMB.d26.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d26}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d27" update="marcacaodente" title="27" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d27.numero}/#{gerenciarOdontogramaMB.d27.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d27}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d28" update="marcacaodente" title="28" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d28.numero}/#{gerenciarOdontogramaMB.d28.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d28}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>

                        <h:panelGrid id="f21" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d21.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d21.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d21.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d21.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d21.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f22" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d22.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d22.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d22.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d22.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d22.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f23" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d23.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d23.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d23.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d23.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d23.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f24" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d24.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d24.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d24.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d24.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d24.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f25" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d25.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d25.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d25.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d25.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d25.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f26" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d26.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d26.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d26.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d26.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d26.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f27" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d27.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d27.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d27.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d27.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d27.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f28" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d28.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d28.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d28.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d28.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d28.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>

                        <h:outputText value="#{gerenciarOdontogramaMB.d21.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d22.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d23.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d24.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d25.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d26.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d27.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d28.numero}"/>
                    </h:panelGrid>

                    <h:panelGrid columns="8" styleClass="table-odontograma" cellspacing="13" style="border-right: 2px solid #A8A8A8; border-top: 2px solid #A8A8A8">

                        <p:commandLink id="d48" update="marcacaodente" title="48" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d48.numero}/#{gerenciarOdontogramaMB.d48.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d48}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d47" update="marcacaodente" title="47" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d47.numero}/#{gerenciarOdontogramaMB.d47.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d47}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d46" update="marcacaodente" title="46" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d46.numero}/#{gerenciarOdontogramaMB.d46.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d46}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d45" update="marcacaodente" title="45" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d45.numero}/#{gerenciarOdontogramaMB.d45.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d45}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d44" update="marcacaodente" title="44" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d44.numero}/#{gerenciarOdontogramaMB.d44.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d44}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d43" update="marcacaodente" title="43" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d43.numero}/#{gerenciarOdontogramaMB.d43.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d43}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d42" update="marcacaodente" title="42" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d42.numero}/#{gerenciarOdontogramaMB.d42.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d42}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d41" update="marcacaodente" title="41" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d41.numero}/#{gerenciarOdontogramaMB.d41.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d41}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>


                        <h:panelGrid id="f48" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d48.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d48.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d48.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d48.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d48.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f47" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d47.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d47.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d47.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d47.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d47.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f46" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d46.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d46.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d46.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d46.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d46.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f45" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d45.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d45.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d45.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d45.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d45.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f44" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d44.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d44.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d44.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d44.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d44.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f43" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d43.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d43.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d43.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d43.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d43.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f42" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d42.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d42.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d42.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d42.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d42.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f41" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d41.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d41.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d41.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d41.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d41.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>

                        <h:outputText value="#{gerenciarOdontogramaMB.d48.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d47.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d46.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d45.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d44.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d43.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d42.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d41.numero}"/>
                    </h:panelGrid>

                    <h:panelGrid columns="8" styleClass="table-odontograma" cellspacing="13" style="border-left: 2px solid #A8A8A8; border-top: 2px solid #A8A8A8">
                        <p:commandLink id="d31" update="marcacaodente" title="31" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d31.numero}/#{gerenciarOdontogramaMB.d31.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d31}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d32" update="marcacaodente" title="32" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d32.numero}/#{gerenciarOdontogramaMB.d32.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d32}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d33" update="marcacaodente" title="33" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d33.numero}/#{gerenciarOdontogramaMB.d33.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d33}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d34" update="marcacaodente" title="34" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d34.numero}/#{gerenciarOdontogramaMB.d34.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d34}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d35" update="marcacaodente" title="35" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d35.numero}/#{gerenciarOdontogramaMB.d35.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d35}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d36" update="marcacaodente" title="36" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d36.numero}/#{gerenciarOdontogramaMB.d36.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d36}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d37" update="marcacaodente" title="37" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d37.numero}/#{gerenciarOdontogramaMB.d37.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d37}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>
                        <p:commandLink id="d38" update="marcacaodente" title="38" >
                            <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.d38.numero}/#{gerenciarOdontogramaMB.d38.estado}.png"/>
                            <f:setPropertyActionListener value="#{gerenciarOdontogramaMB.d38}" target="#{gerenciarOdontogramaMB.denteSelecionado}" />  
                        </p:commandLink>

                        <h:panelGrid id="f31" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d31.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d31.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d31.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d31.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d31.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f32" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d32.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d32.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d32.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d32.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d32.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f33" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d33.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d33.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d33.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d33.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d33.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f34" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d34.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d34.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d34.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d34.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d34.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f35" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d35.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d35.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d35.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d35.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d35.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f36" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d36.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d36.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d36.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d36.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d36.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f37" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d37.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d37.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d37.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d37.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d37.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid id="f38" columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d38.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d38.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d38.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d38.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.d38.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>

                        <h:outputText value="#{gerenciarOdontogramaMB.d31.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d32.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d33.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d34.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d35.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d36.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d37.numero}"/>
                        <h:outputText value="#{gerenciarOdontogramaMB.d38.numero}"/>
                    </h:panelGrid>

                </h:panelGrid>
            </p:fieldset>

            <p:blockUI block="fieldset-odontograma" trigger="d18, d17, d16, d15, d14, d13, d12, d11, d21, d22, d23, d24, d25, d26, d27, d28,
                       d48, d47, d46, d45, d44, d43, d42, d41, d31, d32, d33, d34, d35, d36, d37, d38, :cad:finalizar-marcacao">  
                Carregando...<br />  
                <p:graphicImage library="images" name="loader.gif"/>  
            </p:blockUI>

            <p:blockUI block=":cad:preview" trigger="d18, d17, d16, d15, d14, d13, d12, d11, d21, d22, d23, d24, d25, d26, d27, d28,
                       d48, d47, d46, d45, d44, d43, d42, d41, d31, d32, d33, d34, d35, d36, d37, d38, :cad:finalizar-marcacao">  
                Carregando...<br />  
                <p:graphicImage library="images" name="loader.gif"/>  
            </p:blockUI>

            <p:blockUI block=":cad:carousel" trigger="d18, d17, d16, d15, d14, d13, d12, d11, d21, d22, d23, d24, d25, d26, d27, d28,
                       d48, d47, d46, d45, d44, d43, d42, d41, d31, d32, d33, d34, d35, d36, d37, d38, :cad:finalizar-marcacao">  
                Carregando...<br />  
                <p:graphicImage library="images" name="loader.gif"/>  
            </p:blockUI>

            <h:panelGrid id="marcacaodente" columns="3" styleClass="grupo-form" cellspacing="10">
                <p:carousel id="carousel" value="#{gerenciarOdontogramaMB.denteEstados}" var="estado" itemStyleClass="item-estado" rows="5" easing="">
                    <f:facet name="header">  
                        Estado do Dente  
                    </f:facet>
                    <p:commandLink id="view" update=":cad:preview" title="Escolhar Estado" >
                        <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.denteSelecionado.numero}/#{estado}.png" style="margin-top: 30px;"/>
                        <f:setPropertyActionListener value="#{estado}" target="#{gerenciarOdontogramaMB.denteSelecionado.estado}" />  
                    </p:commandLink>
                </p:carousel>

                <p:panel id="marcando-face" header="Marcação da Face" styleClass="panel-faces">
                    <p:selectOneRadio id="faces-marcacao" value="#{gerenciarOdontogramaMB.faceMarcacao}" layout="custom">  
                        <f:selectItem itemValue="1" />  
                        <f:selectItem itemValue="2" />  
                        <f:selectItem itemValue="3" />
                        <f:selectItem itemValue="4" />
                        <f:selectItem itemValue="5" />
                    </p:selectOneRadio>  
                    <h:panelGrid columns="2" style="width: 100%">
                        <h:outputText value="Face"/>
                        <h:outputText value=""/>
                        <h:panelGrid columns="3" cellpadding="0" cellspacing="7" styleClass="faces-marcacao">
                            <h:outputText value=""/>
                            <p:radioButton id="opt1" for="faces-marcacao" itemIndex="0"/>
                            <h:outputText value=""/>
                            <p:radioButton id="opt2" for="faces-marcacao" itemIndex="1"/>
                            <p:radioButton id="opt3" for="faces-marcacao" itemIndex="2"/>
                            <p:radioButton id="opt4" for="faces-marcacao" itemIndex="3"/>
                            <h:outputText value=""/>
                            <p:radioButton id="opt5" for="faces-marcacao" itemIndex="4"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                        <h:panelGrid columns="1" cellspacing="10">
                            <h:outputText value="Tipo de marcação"/>
                            <p:selectOneMenu value="#{gerenciarOdontogramaMB.tipoMarcacao}">  
                                <f:selectItem itemLabel="Selecione" itemValue="0" />
                                <f:selectItem itemLabel="Cariado" itemValue="p1" />
                                <f:selectItem itemLabel="MBA" itemValue="p2" />
                                <f:selectItem itemLabel="MBI" itemValue="p3" />
                                <f:selectItem itemLabel="Restaurado" itemValue="p4" />
                            </p:selectOneMenu>
                        </h:panelGrid>
                        <h:outputText value=""/>
                        <p:commandButton id="marcar" value="Marcar" update=":cad:message, :cad:preview, marcando-face" action="#{gerenciarOdontogramaMB.marcarFace}" image="ui-icon-pencil" style="float: right" />
                    </h:panelGrid>
                </p:panel>

                <h:panelGrid id="preview" columns="1" styleClass="preview" cellspacing="1">
                    <f:facet name="header">Preview</f:facet>
                    <h:outputText value="#{gerenciarOdontogramaMB.denteSelecionado.numero}" style="font-size: 15px; text-decoration: underline; font-weight: bolder"/>
                    <h:panelGrid columns="2" cellspacing="10" style="width: 100%">
                        <h:graphicImage library="odontograma" name="d#{gerenciarOdontogramaMB.denteSelecionado.numero}/#{gerenciarOdontogramaMB.denteSelecionado.estado}.png"/>
                        <h:panelGrid columns="3" cellpadding="0" cellspacing="0" styleClass="faces">
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.denteSelecionado.faceLingPal}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.denteSelecionado.faceDistal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.denteSelecionado.faceOclusal}.png"/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.denteSelecionado.faceMesial}.png"/>
                            <h:outputText value=""/>
                            <h:graphicImage library="odontograma" name="#{gerenciarOdontogramaMB.denteSelecionado.faceVestibular}.png"/>
                            <h:outputText value=""/>
                        </h:panelGrid>
                    </h:panelGrid>

                </h:panelGrid>
            </h:panelGrid>

            <h:panelGrid columns="1" styleClass="grupo-form" style="text-align: right">
                <p:commandButton id="finalizar-marcacao" value="Finalizar Marcação" update=":cad:grafico-odontograma" action="#{gerenciarOdontogramaMB.finalizarMarcacao}" image="ui-icon-check"/>
            </h:panelGrid>

            <p:blockUI block=":cad:preview" trigger=":cad:carousel:view, :cad:marcar">  
                Carregando...<br />  
                <p:graphicImage library="images" name="loader.gif"/>  
            </p:blockUI>

            <p:separator/>

            <p:fieldset legend="ANOTAÇÕES" toggleable="true" toggleSpeed="500" styleClass="grupo-form">
                <h:panelGrid columns="1" styleClass="table-form" >
                    <p:inputTextarea id="anotacoes" cols="138" value="#{gerenciarOdontogramaMB.odontograma.anotacoes}"/>
                </h:panelGrid>
            </p:fieldset>

            <h:panelGrid columns="1" style="text-align: right; width: 100%; margin-top: 30px">
                <p:commandButton value="Salvar" update=":cad, :dialog" action="#{gerenciarOdontogramaMB.salvarOdontograma}" image="ui-icon-disk" style="font-size: 15px;" />
            </h:panelGrid>
        </h:form>

        <h:form id="dialog">
            <p:dialog header="Pacientes Cadastrados" widgetVar="pacienteDialog" resizable="false" id="pacienteDlg" dynamic="true" 
                      showEffect="fade" hideEffect="fade" modal="true" width="500">
                <p:dataTable id="pacientes" var="paciente" value="#{gerenciarOdontogramaMB.pacienteDataModel}" widgetVar="pacienteTable"
                             selection="#{gerenciarOdontogramaMB.pacienteSelecionado}" selectionMode="single" emptyMessage="Sem pacientes cadastrados"
                             paginator="true" paginatorAlwaysVisible="false" rows="10" paginatorPosition="bottom">

                    <p:ajax id="rowSelect" event="rowSelect" listener="#{gerenciarOdontogramaMB.onRowSelect}"   
                            update=":cad, :dialog" oncomplete="pacienteDialog.hide()" />

                    <f:facet name="header">  
                        Selecione um paciente para a construção do receituário  
                    </f:facet>

                    <p:column headerText="ID" filterBy="#{paciente.id}" filterMatchMode="contains" filterStyle="display:none;">  
                        #{paciente.id}  
                    </p:column>

                    <p:column headerText="NOME" filterBy="#{paciente.nome}" filterMatchMode="contains" filterStyle="display:none;">  
                        #{paciente.nome} #{paciente.sobrenome} 
                    </p:column>

                    <p:column headerText="CPF" filterBy="#{paciente.cpf}" filterMatchMode="contains" filterStyle="display:none;">  
                        #{paciente.cpf}  
                    </p:column>

                    <f:facet name="footer">  
                        <p:outputPanel style="float: right">  
                            <h:outputText value="BUSCAR: " />  
                            <p:inputText id="globalFilter" onkeyup="pacienteTable.filter()" style="width:200px" />  
                        </p:outputPanel> 
                    </f:facet>

                </p:dataTable>
            </p:dialog>
            <p:blockUI block=":cad:fieldset-odontograma" trigger=":cad:gerar-odontograma">  
                Carregando...<br />  
                <p:graphicImage library="images" name="loader.gif"/>  
            </p:blockUI>
        </h:form>
    </ui:define>
</ui:composition>

